package com.sample.presentations
{
	import com.sample.core.events.PageContainerEvent;
	import com.sample.core.models.PageContainerModel;
	import com.sample.core.vos.Globals;
	
	/*
	the main purpose of inheriting presentation model from model 
	is to keep the TASK, VIEW and PRESENTATION package decopled
	*/
	public class PageContainerPresentationModel extends PageContainerModel
	{
		[Inject]
		public var globals:Globals;
		
		[MessageHandler(selector="loadingBegin")]
		public function showLoading(e:PageContainerEvent):void
		{
			isLoading = true;
			loadingMessage = e.loadingMessage;
		}
		
		[MessageHandler(selector="loadingEnd")]
		public function hideLoading(e:PageContainerEvent):void
		{
			isLoading = false;
			loadingMessage = "";
		}
	}
}